import request from '@/utils/request'

// 获取角色信息的接口
// /admin/acl/role/page/limit?roleName=  method: get
export const reqRoleInfo = (page, limit, roleName) => {
    return request({
        url: `/admin/acl/role/${page}/${limit}`,
        method: 'get',
        params: {
            roleName,
        }
    })
}

// 获取添加角色的接口
// /admin/acl/role/save method: post
export const reqAddRole = (data) => {
    return request({
        url: '/admin/acl/role/save',
        method: 'post',
        data,
    })
}

// 获取批量删除角色的接口
// /admin/acl/role/batchRemove
export const reqBatchRemove = (idList) => {
    return request({
        url: '/admin/acl/role/batchRemove',
        method: 'post',
        data: idList
    })
}

// 获取修改角色的接口
// /admin/acl/role/update
export const reqUpdateRole = (role) => {
    return request({
        url: '/admin/acl/role/update',
        method: 'put',
        data: role
    })
}

// 获取删除单个角色的接口
// /admin/acl/role/remove/{id}  method: 'delete'
export const reqRemoveRole = (id) => {
    return request({
        url: `/admin/acl/role/remove/${id}`,
        method: 'delete'
    })
}